package net.jiastudy.biz.assessment.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import io.swagger.annotations.ApiModelProperty;
import net.jiastudy.biz.sys.entity.Dept;
import net.jiastudy.biz.targettask.entity.TaskYear;
import net.jiastudy.core.base.BaseEntity;

public class Assessment extends BaseEntity<Assessment> {
    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "year")
    private Long year;

    @ApiModelProperty(value = "考核部门id")
    private Long assessmentDeptId;

    @ApiModelProperty(value = "被考核部门id")
    private Long assessmentedDeptId;

    @TableField(exist = false)
    @ApiModelProperty(value = "考核人")
    private String userNames;

    @TableField(exist = false)
    private Double score;

    public Double getScore() {
        return score;
    }

    public void setScore(Double score) {
        this.score = score;
    }

    public String getYearTitle() {
        if (null != year) {
            TaskYear taskYear = new TaskYear();
            taskYear = taskYear.selectById(year);

            return taskYear.getTitle();
        }

        return null;
    }

    public String getAssessmentDeptName() {
        if (null != assessmentDeptId) {
            Dept dept = new Dept();
            dept.setId(assessmentDeptId);
            dept = dept.selectById();

            return dept.getName();
        }

        return null;
    }

    public String getAssessmentedDeptName() {
        if (null != assessmentedDeptId) {
            Dept dept = new Dept();
            dept.setId(assessmentedDeptId);
            dept = dept.selectById();

            return dept.getName();
        }

        return null;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getYear() {
        return year;
    }

    public void setYear(Long year) {
        this.year = year;
    }

    public Long getAssessmentDeptId() {
        return assessmentDeptId;
    }

    public void setAssessmentDeptId(Long assessmentDeptId) {
        this.assessmentDeptId = assessmentDeptId;
    }

    public Long getAssessmentedDeptId() {
        return assessmentedDeptId;
    }

    public void setAssessmentedDeptId(Long assessmentedDeptId) {
        this.assessmentedDeptId = assessmentedDeptId;
    }

    public String getUserNames() {
        return userNames;
    }

    public void setUserNames(String userNames) {
        this.userNames = userNames;
    }
}
